themingengine: Use render_background_internal() to render handle background
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sat, 12 Mar 2011 16:02:49 +0000 (17:02 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 13 Mar 2011 01:32:42 +0000 (20:32 -0500)
Instead of using always the background color. This fixes handles that
have a background image like gnome-panel applets in a transparent
panel.

https://bugzilla.gnome.org/show_bug.cgi?id=644570

gtk/gtkthemingengine.c

index 717d530732d6852fc8e3adefd68a16f02883f39b..df09426abeb52eb8ddb28ba7991b5821c540fada 100644 (file)
@@ -2662,12 +2662,14 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
   GtkStateFlags flags;
   GdkRGBA *bg_color;
   GdkRGBA lighter, darker;
+  GtkJunctionSides sides;
   gint xx, yy;
 
   cairo_save (cr);
   flags = gtk_theming_engine_get_state (engine);
 
-  cairo_set_line_width (cr, 1);
+  cairo_set_line_width (cr, 1.0);
+  sides = gtk_theming_engine_get_junction_sides (engine);
 
   gtk_theming_engine_get (engine, flags,
                           "background-color", &bg_color,
@@ -2675,19 +2677,10 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
   color_shade (bg_color, 0.7, &darker);
   color_shade (bg_color, 1.3, &lighter);
 
-  gdk_cairo_set_source_rgba (cr, bg_color);
-  cairo_rectangle (cr, x, y, width, height);
-  cairo_fill (cr);
+  render_background_internal (engine, cr, x, y, width, height, sides);
 
   if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_GRIP))
     {
-      GtkJunctionSides sides;
-
-      cairo_save (cr);
-
-      cairo_set_line_width (cr, 1.0);
-      sides = gtk_theming_engine_get_junction_sides (engine);
-
       /* reduce confusing values to a meaningful state */
       if ((sides & (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)) == (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT))
         sides &= ~GTK_JUNCTION_CORNER_TOPLEFT;
@@ -2932,8 +2925,6 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
               yi += 3;
             }
         }
-
-      cairo_restore (cr);
     }
   else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR))
     {